/**
 * Created by 李柏霖
 * 2020/10/29 10:58
 */

package cn.lbl.face.as;

import java.io.*;
import java.math.BigDecimal;

public class CreditApply {
    //授信编号
    private String SeriaIno;
    //客户名称
    private String Name;
    //担保方式
    private String VouchType;
    //授信金额
    private double Sum;

    //构造方法


    public CreditApply(String seriaIno, String name, String vouchType, double sum) {
        SeriaIno = seriaIno;
        Name = name;
        VouchType = vouchType;
        Sum = sum;
    }

    public String getSeriaIno() {
        return SeriaIno;
    }

    public String getName() {
        return Name;
    }

    public String getVouchType() {
        return VouchType;
    }

    public double getSum() {
        return Sum;
    }

    @Override
    public String toString() {
        return "CreditApply{" +
                "SeriaIno='" + SeriaIno + '\'' +
                ", Name='" + Name + '\'' +
                ", VouchType='" + VouchType + '\'' +
                ", Sum=" + Sum +
                '}';
    }

    public static void main(String[] args) throws IOException {
        CreditApply creditApply1 = new CreditApply("1001", "张三", "抵押", 100000.5);
        CreditApply creditApply2 = new CreditApply("1002", "李四", "抵押", 50000);
        CreditApply creditApply3 = new CreditApply("1003", "王五", "抵押", 30000);
        CreditApply creditApply4 = new CreditApply("1004", "赵六", "抵押", 60000.51);
        File file = new File("credit.txt");
        OutputStreamWriter outputStreamWriter = new FileWriter(file);
        outputStreamWriter.write(creditApply1.toString());
        outputStreamWriter.write(creditApply2.toString());
        outputStreamWriter.write(creditApply3.toString());
        outputStreamWriter.write(creditApply4.toString());
        outputStreamWriter.flush();
        outputStreamWriter.close();
    }
}
